/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.una.informatica.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MARTINCHO
 */
@Entity
@Table(name = "doctor_paciente")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DoctorPaciente.findAll", query = "SELECT d FROM DoctorPaciente d"),
    @NamedQuery(name = "DoctorPaciente.findByIdDoctorPaciente", query = "SELECT d FROM DoctorPaciente d WHERE d.idDoctorPaciente = :idDoctorPaciente")})
public class DoctorPaciente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_doctor_paciente")
    private Long idDoctorPaciente;
    @JoinColumn(name = "id_paciente", referencedColumnName = "id_paciente")
    @ManyToOne(optional = false)
    private Paciente idPaciente;
    @JoinColumn(name = "id_doctor", referencedColumnName = "id_doctor")
    @ManyToOne(optional = false)
    private Doctor idDoctor;

    public DoctorPaciente() {
    }

    public DoctorPaciente(Long idDoctorPaciente) {
        this.idDoctorPaciente = idDoctorPaciente;
    }

    public Long getIdDoctorPaciente() {
        return idDoctorPaciente;
    }

    public void setIdDoctorPaciente(Long idDoctorPaciente) {
        this.idDoctorPaciente = idDoctorPaciente;
    }

    public Paciente getIdPaciente() {
        return idPaciente;
    }

    public void setIdPaciente(Paciente idPaciente) {
        this.idPaciente = idPaciente;
    }

    public Doctor getIdDoctor() {
        return idDoctor;
    }

    public void setIdDoctor(Doctor idDoctor) {
        this.idDoctor = idDoctor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDoctorPaciente != null ? idDoctorPaciente.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DoctorPaciente)) {
            return false;
        }
        DoctorPaciente other = (DoctorPaciente) object;
        if ((this.idDoctorPaciente == null && other.idDoctorPaciente != null) || (this.idDoctorPaciente != null && !this.idDoctorPaciente.equals(other.idDoctorPaciente))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.una.informatica.entidades.DoctorPaciente[ idDoctorPaciente=" + idDoctorPaciente + " ]";
    }
    
}
